package com.nbcio.iot.domain.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.nbcio.iot.domain.entity.IotDevice;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 设备视图对象 iot_device
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = IotDevice.class)
public class IotDeviceVo {

    @ExcelProperty(value = "设备ID")
    private Long deviceId;

    @ExcelProperty(value = "设备名称")
    private String deviceName;

    @ExcelProperty(value = "设备编码")
    private String deviceCode;

    @ExcelProperty(value = "产品ID")
    private Long productId;

    @ExcelProperty(value = "产品名称")
    private String productName;

    @ExcelProperty(value = "产品编码")
    private String productCode;

    /**
     * 绑定的 Node-RED 规则ID
     */
    private Long flowId;

    /** 通信协议类型（设备可覆盖） */
    private String protocolType;

    /** 协议配置覆盖（JSON） */
    private String protocolConfigOverride;

    @ExcelProperty(value = "设备类型")
    private String deviceType;

    @ExcelProperty(value = "分组ID")
    private Long groupId;

    @ExcelProperty(value = "分组名称")
    private String groupName;

    @ExcelProperty(value = "设备IP")
    private String deviceIp;

    @ExcelProperty(value = "设备端口")
    private Integer devicePort;

    @ExcelProperty(value = "设备状态")
    private String deviceStatus;

    @ExcelProperty(value = "设备位置")
    private String location;

    @ExcelProperty(value = "经度")
    private BigDecimal longitude;

    @ExcelProperty(value = "纬度")
    private BigDecimal latitude;

    @ExcelProperty(value = "安装时间")
    private LocalDateTime installTime;

    @ExcelProperty(value = "最后在线时间")
    private LocalDateTime lastOnlineTime;

    @ExcelProperty(value = "备注")
    private String remark;
} 